Optimal. Leaf size=65 \[ -\frac {2 B}{b g^2 (a+b x)}-\frac {(c+d x) \left (A+B \log \left (\frac {e (a+b x)^2}{(c+d x)^2}\right )\right )}{(b c-a d) g^2 (a+b x)} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.03, antiderivative size = 77, normalized size of antiderivative = 1.18, number of steps
used = 2, number of rules used = 2, integrand size = 32, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.062, Rules used = {2550, 2341}
\begin {gather*} -\frac {(c+d x) \left (B \log \left (\frac {e (a+b x)^2}{(c+d x)^2}\right )+A\right )}{g^2 (a+b x) (b c-a d)}-\frac {2 B (c+d x)}{g^2 (a+b x) (b c-a d)} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 2341
Rule 2550
Rubi steps
\begin {align*} \int \frac {A+B \log \left (\frac {e (a+b x)^2}{(c+d x)^2}\right )}{(a g+b g x)^2} \, dx &=-\frac {A+B \log \left (\frac {e (a+b x)^2}{(c+d x)^2}\right )}{b g^2 (a+b x)}+\frac {B \int \frac {2 (b c-a d)}{g (a+b x)^2 (c+d x)} \, dx}{b g}\\ &=-\frac {A+B \log \left (\frac {e (a+b x)^2}{(c+d x)^2}\right )}{b g^2 (a+b x)}+\frac {(2 B (b c-a d)) \int \frac {1}{(a+b x)^2 (c+d x)} \, dx}{b g^2}\\ &=-\frac {A+B \log \left (\frac {e (a+b x)^2}{(c+d x)^2}\right )}{b g^2 (a+b x)}+\frac {(2 B (b c-a d)) \int \left (\frac {b}{(b c-a d) (a+b x)^2}-\frac {b d}{(b c-a d)^2 (a+b x)}+\frac {d^2}{(b c-a d)^2 (c+d x)}\right ) \, dx}{b g^2}\\ &=-\frac {2 B}{b g^2 (a+b x)}-\frac {2 B d \log (a+b x)}{b (b c-a d) g^2}-\frac {A+B \log \left (\frac {e (a+b x)^2}{(c+d x)^2}\right )}{b g^2 (a+b x)}+\frac {2 B d \log (c+d x)}{b (b c-a d) g^2}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.04, size = 111, normalized size = 1.71 \begin {gather*} -\frac {A+B \log \left (\frac {e (a+b x)^2}{(c+d x)^2}\right )}{b g^2 (a+b x)}+\frac {2 B (b c-a d) \left (-\frac {1}{(b c-a d) (a+b x)}-\frac {d \log (a+b x)}{(b c-a d)^2}+\frac {d \log (c+d x)}{(b c-a d)^2}\right )}{b g^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(144\) vs.
\(2(65)=130\).
time = 0.30, size = 145, normalized size = 2.23
method | result | size |
norman | \(\frac {\frac {\left (A +2 B \right ) x}{g a}+\frac {c B \ln \left (\frac {e \left (b x +a \right )^{2}}{\left (d x +c \right )^{2}}\right )}{\left (a d -c b \right ) g}+\frac {B d x \ln \left (\frac {e \left (b x +a \right )^{2}}{\left (d x +c \right )^{2}}\right )}{\left (a d -c b \right ) g}}{g \left (b x +a \right )}\) | \(93\) |
risch | \(-\frac {B \ln \left (\frac {e \left (b x +a \right )^{2}}{\left (d x +c \right )^{2}}\right )}{b \,g^{2} \left (b x +a \right )}-\frac {-2 B \ln \left (-b x -a \right ) b d x +2 B \ln \left (d x +c \right ) b d x -2 B \ln \left (-b x -a \right ) a d +2 B \ln \left (d x +c \right ) a d +A a d -A b c +2 B a d -2 B b c}{g^{2} \left (b x +a \right ) b \left (a d -c b \right )}\) | \(132\) |
derivativedivides | \(-\frac {-\frac {d^{2} A}{g^{2} \left (\frac {a d -c b}{d x +c}+b \right ) \left (a d -c b \right )}+\frac {\frac {2 d^{2} B}{b g \left (d x +c \right )}-\frac {d^{2} B \ln \left (\frac {e \left (\frac {a d}{d x +c}-\frac {b c}{d x +c}+b \right )^{2}}{d^{2}}\right )}{g \left (a d -c b \right )}}{g \left (\frac {a d}{d x +c}-\frac {b c}{d x +c}+b \right )}}{d}\) | \(145\) |
default | \(-\frac {-\frac {d^{2} A}{g^{2} \left (\frac {a d -c b}{d x +c}+b \right ) \left (a d -c b \right )}+\frac {\frac {2 d^{2} B}{b g \left (d x +c \right )}-\frac {d^{2} B \ln \left (\frac {e \left (\frac {a d}{d x +c}-\frac {b c}{d x +c}+b \right )^{2}}{d^{2}}\right )}{g \left (a d -c b \right )}}{g \left (\frac {a d}{d x +c}-\frac {b c}{d x +c}+b \right )}}{d}\) | \(145\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 190 vs.
\(2 (66) = 132\).
time = 0.31, size = 190, normalized size = 2.92 \begin {gather*} -B {\left (\frac {\log \left (\frac {b^{2} x^{2} e}{d^{2} x^{2} + 2 \, c d x + c^{2}} + \frac {2 \, a b x e}{d^{2} x^{2} + 2 \, c d x + c^{2}} + \frac {a^{2} e}{d^{2} x^{2} + 2 \, c d x + c^{2}}\right )}{b^{2} g^{2} x + a b g^{2}} + \frac {2}{b^{2} g^{2} x + a b g^{2}} + \frac {2 \, d \log \left (b x + a\right )}{{\left (b^{2} c - a b d\right )} g^{2}} - \frac {2 \, d \log \left (d x + c\right )}{{\left (b^{2} c - a b d\right )} g^{2}}\right )} - \frac {A}{b^{2} g^{2} x + a b g^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.34, size = 108, normalized size = 1.66 \begin {gather*} -\frac {{\left (A + 2 \, B\right )} b c - {\left (A + 2 \, B\right )} a d + {\left (B b d x + B b c\right )} \log \left (\frac {{\left (b^{2} x^{2} + 2 \, a b x + a^{2}\right )} e}{d^{2} x^{2} + 2 \, c d x + c^{2}}\right )}{{\left (b^{3} c - a b^{2} d\right )} g^{2} x + {\left (a b^{2} c - a^{2} b d\right )} g^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 255 vs.
\(2 (54) = 108\).
time = 1.04, size = 255, normalized size = 3.92 \begin {gather*} - \frac {B \log {\left (\frac {e \left (a + b x\right )^{2}}{\left (c + d x\right )^{2}} \right )}}{a b g^{2} + b^{2} g^{2} x} - \frac {2 B d \log {\left (x + \frac {- \frac {2 B a^{2} d^{3}}{a d - b c} + \frac {4 B a b c d^{2}}{a d - b c} + 2 B a d^{2} - \frac {2 B b^{2} c^{2} d}{a d - b c} + 2 B b c d}{4 B b d^{2}} \right )}}{b g^{2} \left (a d - b c\right )} + \frac {2 B d \log {\left (x + \frac {\frac {2 B a^{2} d^{3}}{a d - b c} - \frac {4 B a b c d^{2}}{a d - b c} + 2 B a d^{2} + \frac {2 B b^{2} c^{2} d}{a d - b c} + 2 B b c d}{4 B b d^{2}} \right )}}{b g^{2} \left (a d - b c\right )} + \frac {- A - 2 B}{a b g^{2} + b^{2} g^{2} x} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 188 vs.
\(2 (66) = 132\).
time = 2.40, size = 188, normalized size = 2.89 \begin {gather*} {\left (2 \, {\left (b^{2} c g^{2} - a b d g^{2}\right )} {\left (\frac {d \log \left ({\left | \frac {b c g}{b g x + a g} - \frac {a d g}{b g x + a g} + d \right |}\right )}{b^{4} c^{2} g^{4} - 2 \, a b^{3} c d g^{4} + a^{2} b^{2} d^{2} g^{4}} - \frac {1}{{\left (b^{2} c g^{2} - a b d g^{2}\right )} {\left (b g x + a g\right )} b g}\right )} - \frac {\log \left (\frac {{\left (b x + a\right )}^{2} e}{{\left (d x + c\right )}^{2}}\right )}{{\left (b g x + a g\right )} b g}\right )} B - \frac {A}{{\left (b g x + a g\right )} b g} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 5.25, size = 108, normalized size = 1.66 \begin {gather*} -\frac {A+2\,B}{x\,b^2\,g^2+a\,b\,g^2}-\frac {B\,\ln \left (\frac {e\,{\left (a+b\,x\right )}^2}{{\left (c+d\,x\right )}^2}\right )}{b^2\,g^2\,\left (x+\frac {a}{b}\right )}-\frac {B\,d\,\mathrm {atan}\left (\frac {b\,c\,2{}\mathrm {i}+b\,d\,x\,2{}\mathrm {i}}{a\,d-b\,c}+1{}\mathrm {i}\right )\,4{}\mathrm {i}}{b\,g^2\,\left (a\,d-b\,c\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________